<template>
  <div class="school">
    <h1>学校名称：{{name}}</h1>
    <h1>学校地址：{{address}}</h1>
    <button @click="sendSchoolName">点我将学校名字给App</button>
  </div>
</template>

<script>
  export default {
      name: "School",
      data(){
        return{
          name:"幸福中学",
          address:"重庆市渝北区"
        }
      },
    props:['getSchoolName'],
    methods:{
      sendSchoolName(){
        this.getSchoolName(this.name)
      }
    }
  }
</script>

<style scoped>
.school{
  background-color: skyblue;
}
</style>
